package com.gxa.shop.filter;//package com.gxa.filter; /**
// * ${PACKAGE_NAME}.${NAME}
// * User: hly
// * Date: 2024/11/22 14:18
// * motto:   逆水行舟不进则退
// * Description:
// * Version: v1.0
// */
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//import java.io.IOException;
//
//@WebFilter(urlPatterns = "/bus_card/*")
//public class CheckLoginFilter implements Filter {
//    public void init(FilterConfig config) throws ServletException {
//    }
//
//    public void destroy() {
//    }
//
//    @Override
//    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
//        HttpSession session = ((HttpServletRequest) request).getSession();
//
//        Object admin=session.getAttribute("admin");
//        if(admin!=null)
//            chain.doFilter(request, response);
//        else
//            ((HttpServletResponse)response).sendRedirect("/login.html");
//    }
//
//}
